<?php
/*********************************************************************************
 * SugarCRM is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
$dictionary['edanz_Beneficiaries'] = array(
	'table'=>'edanz_beneficiaries',
	'audited'=>true,
	'fields'=>array (
		// 'is_primary' => array(
			// 'name' => 'is_primary',
			// 'vname' => 'LBL_PRIMARY',
			// 'type' => 'bool',
			// 'default' => '1',
		// ),
		
		'bank_name' => array (
            'name' => 'bank_name',
            'vname' => 'LBL_BANK_NAME',
            'type' => 'varchar',
            'len' => '100',
        ),

		'branch_name' => array (
            'name' => 'branch_name',
            'vname' => 'LBL_BRANCH_NAME',
            'type' => 'varchar',
            'len' => '100',
        ),

		// 'bank_account_name' => array (
            // 'name' => 'bank_account_name',
            // 'vname' => 'LBL_BANK_ACCOUNT_NAME',
            // 'type' => 'varchar',
            // 'len' => '100',
        // ),

		'bank_account_number' => array (
            'name' => 'bank_account_number',
            'vname' => 'LBL_BANK_ACCOUNT_NUMBER',
            'type' => 'varchar',
            'len' => '100',
        ),

		'branch_code' => array (
            'name' => 'branch_code',
            'vname' => 'LBL_BRANCH_CODE',
            'type' => 'varchar',
            'len' => '100',
        ),

		'iban_number' => array (
            'name' => 'iban_number',
            'vname' => 'LBL_IBAN_NUMBER',
            'type' => 'varchar',
            'len' => '100',
        ),

		'swift_code' => array (
            'name' => 'swift_code',
            'vname' => 'LBL_SWIFT_CODE',
            'type' => 'varchar',
            'len' => '100',
        ),

		'branch_address' => array (
            'name' => 'branch_address',
            'vname' => 'LBL_BRANCH_ADDRESS',
            'type' => 'text',
        ),

		'branch_city' => array (
            'name' => 'branch_city',
            'vname' => 'LBL_BRANCH_CITY',
            'type' => 'varchar',
		'len' => '100',
        ),

		'branch_state' => array (
            'name' => 'branch_state',
            'vname' => 'LBL_BRANCH_STATE',
            'type' => 'varchar',
            'len' => '100',
        ),

		'branch_postalcode' => array (
            'name' => 'branch_postalcode',
            'vname' => 'LBL_BRANCH_POSTALCODE',
            'type' => 'varchar',
            'len' => '100',
        ),

		'banking_country' => array(
            'name' => 'banking_country',
            'vname' => 'LBL_BANKING_COUNTRY',
            'type' => 'enum',
            'len' => '100',
            'options' => 'banking_countries_dom',
        ),

		'banking_currency' => array(
			'name' => 'banking_currency',
			'vname' => 'LBL_BANKING_CURRENCY',
			'type' => 'enum',
			'len' => '100',
			'options' => 'currency_dom',
        ),
		
		// 'payment_method' => array(
			// 'name' => 'payment_method',
			// 'vname' => 'LBL_PAYMENT_METHOD',
			// 'type' => 'enum',
			// 'len' => '100',
			// 'options' => 'payment_method_dom',
        // ),

		// 'bank_info_note' => array (
            // 'name' => 'bank_info_note',
            // 'vname' => 'LBL_BANK_INFO_NOTE',
            // 'type' => 'text',
        // ),

		'intermediary_bank_name' => array (
            'name' => 'intermediary_bank_name',
            'vname' => 'LBL_INTERMEDIARY_BANK_NAME',
            'type' => 'varchar',
            'len' => '100',
        ),

		'intermediary_bank_account_number' => array (
            'name' => 'intermediary_bank_account_number',
            'vname' => 'LBL_INTERMEDIARY_BANK_ACCOUNT_NUMBER',
            'type' => 'varchar',
            'len' => '100',
        ),

		'intermediary_bank_account_name' => array (
            'name' => 'intermediary_bank_account_name',
            'vname' => 'LBL_INTERMEDIARY_BANK_ACCOUNT_NAME',
            'type' => 'varchar',
            'len' => '100',
        ),

		'intermediary_bank_swift_code' => array (
            'name' => 'intermediary_bank_swift_code',
            'vname' => 'LBL_INTERMEDIARY_BANK_SWIFT_CODE',
            'type' => 'varchar',
            'len' => '100',
        ),

		'intermediary_bank_info_note' => array (
            'name' => 'intermediary_bank_info_note',
            'vname' => 'LBL_INTERMEDIARY_BANK_INFO_NOTE',
            'type' => 'text',
        ),
		
		'editors_beneficiaries' => array(
			'name'=>'editors_beneficiaries',
			'vname'=>'LBL_RELATED_EDITOR',
			'type'=>'link',
			'relationship'=>'editors_beneficiaries',
			'source' => 'non-db',
			'module' => 'edanz_Beneficiaries',
			'bean_name' => 'edanz_Beneficiaries',
		),
		
		'editors_beneficiaries_fields' =>  array ( 
			'name' => 'editors_beneficiaries_fields', 
			'rname' => 'id', 
			'relationship_fields'=>array(
				'id' => 'editors_beneficiaries_id',
				'primary_beneficiary' => 'primary_beneficiary',
			),
			'vname' => 'LBL_BENEFICIARY_PRIMARY', 
			'type' => 'relate', 
			'link' => 'editors_beneficiaries', 
	//		'join_link_name' => 'editors_beneficiaries', 
			'link_type' => 'relationship_info', 
			'source' => 'non-db', 
			'Importable' => false, 
			'duplicate_merge'=> 'disabled', 
//			'join_name' => 'editors_beneficiaries', 
		),
		'editors_beneficiaries_id' =>  array( 
			'name' => 'editors_beneficiaries_id', 
			'type' => 'varchar', 
			'source' => 'non-db', 
			'vname' => 'LBL_BENEFICIARY_PRIMARY_ID', 
		),
		'primary_beneficiary' => array( 
			'name' => 'primary_beneficiary', 
			'type' => 'varchar', 
			'source' => 'non-db', 
			'vname' => 'LBL_BENEFICIARY_PRIMARY', 
			'massupdate' => false, 
		),
		
		// 'related_editor_id' => array (
			// 'name' => 'related_editor_id',
			// 'rname' => 'id',
			// 'vname' => 'LBL_RELATED_EDITOR_ID',
			// //'type' => 'id',
			// 'table' => 'users',
			// 'module' => 'edanz_Editor',
			// 'reportable'=>true,
			// 'dbType' => 'id',
			// 'audited'=>true,
			// 'duplicate_merge'=>'disabled',
			
			
			// //'rname' => 'user_name',
			// 'id_name' => 'related_editor_id',
			// 'group'=>'related_editor_name',
			// 'type' => 'relate',
			// //'module' => 'Users',
			// 'isnull' => 'false',
			// 'audited'=>true,
			// 'comment' => 'Editor ID assigned to record',
		// ),
		// 'related_editor_name' => array (
			// 'name' => 'related_editor_name',
			// 'vname' => 'LBL_RELATED_EDITOR_NAME',
			// //'rname' => 'full_name',
			// 'type' => 'relate',
			// 'source'=>'non-db',
			// 'table' => 'users',
			// 'id_name' => 'related_editor_id',
			// 'module'=>'edanz_Editor',
			// //'custom_type'=>'if this value isnt empty, we can use it as an email template variable',
			
			
			
		    // 'link'=>'related_editor_link' ,
		    // 'rname' => 'user_name',
		    // 'reportable'=>false,
		    // //'module'=>'Users',
		    // 'duplicate_merge'=>'disabled' 
		// ),
		// 'related_editor_link' => array (
			// 'name' => 'related_editor_link',
			// //'rname'=>'full_name',
			// 'id_name'=>'related_editor_id',
			// 'vname'=>'LBL_RELATED_EDITOR',
			// //'type'=>'relate',
			// 'isnull'=>'true',
			// 'table' => 'users',
			// 'module'=>'edanz_Editor',
			// 'source' => 'non-db',
			// 'bean_name'=>'edanz_Editor',
			
			
    // 'type' => 'link',
    // 'relationship' => 'beneficiaries_related_editor',
    // 'link_type' => 'one',
    // //'module'=>'Users',
    // //'bean_name'=>'User',
    // 'duplicate_merge'=>'enabled',
    // 'rname' => 'user_name',
		// ),
	),
	'relationships'=>array (
		// 'beneficiaries_related_editor' => array(
			// 'lhs_module'=> 'edanz_Editor',
			// 'lhs_table'=> 'users',
			// 'lhs_key' => 'id',
			// 'rhs_module'=> 'edanz_Beneficiaries',
			// 'rhs_table'=> 'edanz_beneficiaries',
			// 'rhs_key' => 'related_editor_id',
			// 'relationship_type'=>'one-to-many'
		// )
),
	'optimistic_locking'=>true,
);

$dictionary["edanz_Beneficiaries"]["fields"]["edanz_editors_edanz_beneficiaries"] = array (
	  'name' => 'edanz_editors_edanz_beneficiaries',
	  'type' => 'link',
	  'relationship' => 'edanz_editors_edanz_beneficiaries',
	  'source' => 'non-db',
	  'vname' => 'LBL_EDITOR_SUBPANEL_TITLE',
	);
if (!class_exists('VardefManager')){
        require_once('include/SugarObjects/VardefManager.php');
}
VardefManager::createVardef('edanz_Beneficiaries','edanz_Beneficiaries', array('basic'));
